//
//  CompanyTableViewCell.m
//  XRSquare
//
//  Created by UaenaMo on 2018/8/14.
//  Copyright © 2018年 UaenaMo. All rights reserved.
//

#import "CompanyTableViewCell.h"

@interface CompanyTableViewCell ()
{
    UIImageView * imageView;
    UILabel * titleLabel;
    UILabel * goodRate;
    UILabel * typel;
}
@end

@implementation CompanyTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        imageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, 60, 60)];
        [self addSubview:imageView];
        
        titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(80, 10, ScreenWidth - 80, 20)];
        titleLabel.font = [UIFont systemFontOfSize:14];
        [self addSubview:titleLabel];
        
        goodRate = [[UILabel alloc]initWithFrame:CGRectMake(80, 30, ScreenWidth - 80, 20)];
        goodRate.font = [UIFont systemFontOfSize:11];
        [self addSubview:goodRate];
        
        typel = [[UILabel alloc]initWithFrame:CGRectMake(80, 50, ScreenWidth - 80, 20)];
        typel.font = [UIFont systemFontOfSize:11];
        [self addSubview:typel];
        
        UIView * line = [[UIView alloc]initWithFrame:CGRectMake(0, 80, ScreenWidth, 5)];
        line.backgroundColor = [UIColor colorFromHexCode:@"f3f3f3"];
        [self addSubview:line];
    }
    return self;
}

+(CGFloat)height
{
    return 85;
}

-(void)loadimage:(NSString *)image title:(NSString *)title rate:(NSString *)rate type:(NSString *)type
{
    [imageView sd_setImageWithURL:[NSURL URLWithString:image]];
    titleLabel.text = title;
    goodRate.text = [NSString stringWithFormat:@"好评率%@",rate];
    typel.text = type;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
